<?php
declare(strict_types=1);

namespace LowCode\Naive;

use LowCode\Naive;
use LowCode\Node;
use LowCode\Support\JsExp;
use LowCode\Traits\Props\HasDescription;
use LowCode\Traits\Props\HasDisabled;
use LowCode\Traits\Props\HasTitle;
use LowCode\Traits\Slots\HasSlotIcon;
use LowCode\Traits\Slots\HasSlotTitle;

/**
 * NStep组件
 * @method static static make(string|JsExp|Node $title, mixed $children = null) NStep组件
 */
class Step extends Naive
{
    use HasTitle, HasDescription, HasDisabled;

    use HasSlotTitle, HasSlotIcon;

    /**
     * @param string|JsExp|Node $title
     * @param mixed|null $children
     */
    public function __construct(string|JsExp|Node $title, mixed $children = null)
    {
        parent::__construct();
        if ($title instanceof Node){
            $this->slotTitle($title);
        }else{
            $this->title($title);
        }
        $this->children($children);
    }

    /**
     * @param string|JsExp $status
     * @return $this
     */
    public function status(string|JsExp $status = 'process' | 'finish' | 'error' | 'wait'): static
    {
        return $this->prop("status",$status);
    }
}
